<?php

/**
 * 入口文件
 * 
 * @author ShuangYa
 * @package SYFramework
 * @category Base
 * @link http://www.sylingd.com/
 * @copyright Copyright (c) 2015 ShuangYa
 * @license http://lab.sylingd.com/go.php?name=framework&type=license
 */

use \sy\swoole\Server;

require (__DIR__ . '/framework/sy.php');

$config = __DIR__ . '/euser/config.php';

Sy::createSwooleApplication(__DIR__ . '/public/', $config);
//添加监听
Server::addListener('TCP', 'api');
Server::addEventHandle('Receive', Server::getPort('api'), '\euser\libs\APIServer::callback');
Server::addEventHandle('Connect', Server::getPort('api'), '\euser\libs\APIServer::connect');
Server::addEventHandle('Close', Server::getPort('api'), '\euser\libs\APIServer::close');
//启动服务
Server::start();